﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package com.yy.ui.containers {
    import flash.display.*;
    import flash.geom.*;
    import com.fminutes.vinciUI.events.*;
    import com.fminutes.vinciUI.core.*;

    public class RollContainer extends UISprite {

        private var _childList:ChildListContainer;
        private var _showRect:Rectangle;
        private var _walkRect:Rectangle;
        private var _top:Number = 0;
        private var _left:Number = 0;
        private var _width:Number = 100;
        private var _height:Number = 100;

        public function RollContainer(){
            this._childList = new ChildListContainer();
            super.addChild(this._childList);
        }
        public function get childList():ChildListContainer{
            return (this._childList);
        }
        public function getBitmapData(_arg1:Number=1):BitmapData{
            var _local2:Number = this.childList.width;
            var _local3:Number = this.childList.height;
            var _local4:BitmapData = new BitmapData((_local2 * _arg1), (_local3 * _arg1), false);
            _local4.draw(this.childList, new Matrix(_arg1, 0, 0, _arg1));
            return (_local4);
        }
        public function set showRect(_arg1:Rectangle):void{
            this._showRect = _arg1;
            this.top = this.top;
            this.left = this.left;
        }
        public function get showRect():Rectangle{
            return (this._showRect);
        }
        public function get walkRect():Rectangle{
            return (this._walkRect);
        }
        public function set walkRect(_arg1:Rectangle):void{
            this._walkRect = _arg1;
        }
        private function get minTop():Number{
            if (this.showRect == null){
                return (0);
            };
            return (this.showRect.top);
        }
        private function get minLeft():Number{
            if (this.showRect == null){
                return (0);
            };
            return (this.showRect.left);
        }
        private function get minHeight():Number{
            if (this.showRect == null){
                return (this.childList.height);
            };
            return ((this.showRect.top + this.showRect.height));
        }
        private function get minWidth():Number{
            if (this.showRect == null){
                return (this.childList.width);
            };
            return ((this.showRect.left + this.showRect.width));
        }
        public function reRoll():void{
            this.scrollRect = new Rectangle(this.left, this.top, this.width, this.height);
            dispatchEvent(new UIEvent(UIEvent.ROLL));
        }
        public function set top(_arg1:Number):void{
            var _local2:Number;
            if (_arg1 < this.minTop){
                _arg1 = this.minTop;
            } else {
                _local2 = (this.minHeight - this.height);
                if (_local2 <= this.minTop){
                    _arg1 = this.minTop;
                } else {
                    if (_arg1 > _local2){
                        _arg1 = _local2;
                    };
                };
            };
            this._top = _arg1;
        }
        public function get top():Number{
            return (this._top);
        }
        public function set left(_arg1:Number):void{
            var _local2:Number;
            if (_arg1 < this.minLeft){
                _arg1 = this.minLeft;
            } else {
                _local2 = (this.minWidth - this.width);
                if (_local2 <= this.minLeft){
                    _arg1 = this.minLeft;
                } else {
                    if (_arg1 > _local2){
                        _arg1 = _local2;
                    };
                };
            };
            this._left = _arg1;
        }
        public function get left():Number{
            return (this._left);
        }
        override public function set width(_arg1:Number):void{
            var _local2:Number = (this.minWidth - _arg1);
            if (_local2 <= 0){
                this.left = this.minLeft;
            } else {
                if (this.left > _local2){
                    this.left = _local2;
                };
            };
            this._width = _arg1;
        }
        override public function get width():Number{
            return (this._width);
        }
        override public function set height(_arg1:Number):void{
            var _local2:Number = (this.minHeight - _arg1);
            if (_local2 <= 0){
                this.top = this.minTop;
            } else {
                if (this.top > _local2){
                    this.top = _local2;
                };
            };
            this._height = _arg1;
        }
        override public function get height():Number{
            return (this._height);
        }
        override public function get numChildren():int{
            return (this.childList.numChildren);
        }
        override public function addChild(_arg1:DisplayObject):DisplayObject{
            return (this._childList.addChild(_arg1));
        }
        override public function addChildAt(_arg1:DisplayObject, _arg2:int):DisplayObject{
            return (this._childList.addChildAt(_arg1, _arg2));
        }
        override public function removeChild(_arg1:DisplayObject):DisplayObject{
            return (this._childList.removeChild(_arg1));
        }
        override public function removeChildAt(_arg1:int):DisplayObject{
            return (this._childList.removeChildAt(_arg1));
        }
        override public function getChildAt(_arg1:int):DisplayObject{
            return (this._childList.getChildAt(_arg1));
        }
        override public function getChildByName(_arg1:String):DisplayObject{
            return (this._childList.getChildByName(_arg1));
        }
        override public function getChildIndex(_arg1:DisplayObject):int{
            return (this._childList.getChildIndex(_arg1));
        }

    }
}
import com.yy.base.YYSprite;

class ChildListContainer extends YYSprite {

    public function ChildListContainer(){
    }
    override public function get width():Number{
        var _local3:Number;
        var _local1:Number = 0;
        var _local2:int;
        while (_local2 < numChildren) {
            _local3 = (getChildAt(_local2).width + getChildAt(_local2).x);
            if (_local3 > _local1){
                _local1 = _local3;
            };
            _local2++;
        };
        return (_local1);
    }
    override public function get height():Number{
        var _local3:Number;
        var _local1:Number = 0;
        var _local2:int;
        while (_local2 < numChildren) {
            _local3 = (getChildAt(_local2).height + getChildAt(_local2).y);
            if (_local3 > _local1){
                _local1 = _local3;
            };
            _local2++;
        };
        return (_local1);
    }

}
